home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWPasta.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  3.4 KB  |  123 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPasta.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. #ifndef FWPASTA_H
  10. #define FWPASTA_H
  11.  
  12. // ----- Framework Includes -----
  13.  
  14. #ifndef FWPRTDEF_H
  15. #include "FWPrtDef.h"
  16. #endif
  17.  
  18. // ----- Foundation Includes -----
  19.  
  20. #ifndef FWSTDDEF_H
  21. #include "FWStdDef.h"
  22. #endif
  23.  
  24. #ifndef FWRUNTYP_H
  25. #include "FWRunTyp.h"
  26. #endif
  27.  
  28. // ----- OpenDoc Includes -----
  29.  
  30. #ifndef FWODTYPS_H
  31. #include "FWODTyps.h"
  32. #endif
  33.  
  34. //========================================================================================
  35. //    Forward Declarations
  36. //========================================================================================
  37.  
  38. class ODStorageUnit;
  39. class FW_CFrame;
  40. class FW_CLinkDestination;
  41.  
  42. //========================================================================================
  43. //     class FW_MPasteAsHandler
  44. //========================================================================================
  45.  
  46. class FW_MPasteAsHandler
  47. {
  48. //----------------------------------------------------------------------------------------
  49. //    Constructor/Destructors
  50. //
  51.   public:
  52.     FW_MPasteAsHandler(Environment *ev, FW_CFrame* frame);
  53.  
  54.     virtual ~ FW_MPasteAsHandler();
  55.     
  56. //----------------------------------------------------------------------------------------
  57. //    Public API
  58. //
  59.   public:
  60.     FW_Boolean    HandleDropPasteAsDialog(Environment* ev, 
  61.                                     ODStorageUnit* dropSU, 
  62.                                     FW_Boolean& handledDrop);    // drag&drop version
  63.  
  64.     FW_Boolean    HandlePasteAsDialog(Environment* ev, 
  65.                                     ODCloneKind cloneKind, 
  66.                                     FW_Boolean& handledIt);        // clipboard version
  67.  
  68.     FW_Boolean    WantsEmbedAs(Environment* ev) const;
  69.     FW_Boolean    WantsTranslation(Environment* ev) const;
  70.  
  71.     FW_CLinkDestination* GetNewLink(Environment* ev) const;
  72.     ODPasteAsResult* GetEmbedInfoPtr(Environment* ev);
  73.  
  74. //----------------------------------------------------------------------------------------
  75. //    Private API
  76. //
  77.   private:
  78.     FW_Boolean    PostPasteAsDialog(Environment* ev, 
  79.                                   ODStorageUnit* storageUnit,
  80.                                   FW_EStorageKinds storageKind,
  81.                                   ODCloneKind cloneKind, 
  82.                                   FW_Boolean& handledIt);
  83.  
  84.     FW_Boolean    PasteAsEmbed(Environment* ev, 
  85.                              ODStorageUnit* storageUnit,
  86.                              FW_EStorageKinds storageKind,
  87.                              ODCloneKind cloneKind);
  88.  
  89.   private:
  90.     FW_CLinkDestination*    fNewLink;            // NULL if no link created
  91.     ODPasteAsResult            fEmbedInfo;
  92.     FW_CFrame*                fPrivFrame;
  93. };
  94.  
  95. //========================================================================================
  96. //    Inlines
  97. //========================================================================================
  98.  
  99. inline ODPasteAsResult* FW_MPasteAsHandler::GetEmbedInfoPtr(Environment*)
  100. {
  101.     return &fEmbedInfo;
  102. }
  103.  
  104. //----------------------------------------------------------------------------------------
  105. inline FW_CLinkDestination* FW_MPasteAsHandler::GetNewLink(Environment*) const
  106. {
  107.     return fNewLink;
  108. }
  109.  
  110. //----------------------------------------------------------------------------------------
  111. inline FW_Boolean FW_MPasteAsHandler::WantsEmbedAs(Environment*) const
  112. {
  113.     return (fEmbedInfo.mergeSetting == FALSE);
  114. }
  115.  
  116. //----------------------------------------------------------------------------------------
  117. inline FW_Boolean FW_MPasteAsHandler::WantsTranslation(Environment*) const
  118. {
  119.     return (fEmbedInfo.translateKind != NULL);
  120. }
  121.  
  122. #endif
  123.